<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>印章详情</title>
</head>
<body class="layui-layout-body">

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="body_right">
            <h4 class="nav_title">印章详情</h4>
               <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
			        <ul class="layui-tab-title">
			            <li lay-id="APPLY_LIST">申请记录</li>
			            <li lay-id="USED_LIST">使用记录</li>
			        </ul>
			        <div class="layui-tab-content" >
			            <div class="layui-tab-item layui-show">
		            			 
					          <xblock style="margin-bottom:0px">
						        <button class="layui-btn layui-btn-normal layui-btn-sm" onClick="openwinx('绑定设备','/seal/binding.htm?sealId=${query.sealId}',500,300);">绑定设备</button>
						      </xblock>
					          
					          <table class="layui-table layui-form" lay-even="" lay-skin="nob">
								  <thead>
								    <tr>
								      <th>设备标识</th>
								      <th>型号</th>
								      <th>开通日期</th>
								      <th>失效日期</th>
								      <th>已用次数</th>
								      <th>版本号</th>
								      <th>状态</th>
								      <th>操作</th>
								    </tr> 
								  </thead>
								  <tbody>
								    <#list deviceses as item>
								    <tr>
								      <td>${item.alias}</td>
								      <td>${item.model}</td>
								      <td>
								      	<#if item.installTime??>
								      		${item.installTime?string('yyyy-MM-dd HH:mm:ss')}
								      	<#else>
								      		待安装
								      	</#if>
								      </td>
								      <td>
								      	<#if item.expireDate??>
								      	${item.expireDate?string('yyyy-MM-dd')}
								      	</#if>
								      
								      </td>
								      <td>${item.useTimes}</td>
								      <td>${item.devicesVerson}</td>
								      <td>
								      		<@linkage type="DEVICES_STATUS" key=item.devicesStatus>
									        		<span class="${linkage.style}">${linkage.name}</span>
									        	</@linkage>
								      </td>
								      <td>
								      
								      		<#if item.devicesStatus =='WAIT_INSTALL'>
								      			<!--
			                        			<a href="javascript:openwinx('请使用微信扫描二维码安装','/devices/install.htm?devicesId=${item.devicesId}',500,500);">安装</a> | 
			                        			-->
			                        			<a href="javascript:xconfirm('确认是否完成安装','/devices/install/confirm.htm',{devicesId:'${item.devicesId}'});">确认已安装</a>
			                        		</#if>
			                        		<#if item.devicesStatus =='WAIT_TEST'>
			                        			
			                        			<a href="javascript:openwinx('请使用微信扫描二维码安装','/devices/test.htm?devicesId=${item.devicesId}&sealId=${item.sealId}',500,500);">测试</a> | 
			                        			
			                        		</#if>
			                        		
			                        		<#if item.devicesStatus =='WAIT_UPLOAD_VOUCHER'>
			                        		<!--
			                        		    <a href="javascript:xconfirm('确认是否发布？','/devices/publish.htm',{devicesId:'${item.devicesId}'});">重新测试</a> | 
			                        		    -->
			                        		</#if>
			                        		<#if item.devicesStatus =='WAIT_ACTIVATE'>
			                        		<!--
			                        		<a href="javascript:xconfirm('确认是否发布？','/devices/publish.htm',{devicesId:'${item.devicesId}'});">重新测试</a> | 
			                        		-->
			                        			<a href="javascript:xconfirm('确认是否发布？','/devices/publish.htm',{devicesId:'${item.devicesId}'});">发布</a> 
			                        		</#if>
								      	
										<a href="javascript:openwinx('设备详情','/seal/devicesInfo.htm?devicesId=${item.devicesId}',1100,600);">详情</a>					      	
								      
								      </td>
								    </tr>
								    </#list>
								  </tbody>
								</table>
		                </div>
		            </div>
		       </div>
        </div>
     </div>
  
     
	<script>
        //JavaScript代码区域
        layui.use(['element','form','layedit','laypage'], function(){
            var element = layui.element;
            var form = layui.form;
            var   layer = layui.layer;
            
            element.on('tab(docDemoTabBrief)', function(elem){
		  		var id = $(this).attr('lay-id');
		  		if(id == 'INFO'){
		  		 	location.href='/seal/info.htm?sealId=${query.sealId}';
		  		}
		  		
		  		if(id == 'APPLY_LIST'){
		  			location.href='/seal/applyList.htm?sealId=${query.sealId}';
		  		}
		  		
		  		if(id == 'USED_LIST'){
		  			location.href='/seal/usedList.htm?sealId=${query.sealId}';
		  		}
		   });
          
        });
    </script>     
</body>
</html>